package cn.hrlly.tao2shou.presenter;

import android.content.Context;

import java.util.ArrayList;

import cn.hrlly.tao2shou.biz.ShowHistoryCommoditiesBiz;
import cn.hrlly.tao2shou.biz.ShowHistoryCommoditiesBizImpl;
import cn.hrlly.tao2shou.domain.Commodities;
import cn.hrlly.tao2shou.listener.OnShowHistoryCommoditiesListener;
import cn.hrlly.tao2shou.view.view_interface.ShowHistoryCommoditiesView;

/**
 * User: gengliang
 * Date: 2016-02-02
 * Time: 22:57
 */

public class ShowHistoryCommoditiesPresenterImpl implements ShowHistoryCommoditiesPresenter,OnShowHistoryCommoditiesListener {

    private ShowHistoryCommoditiesBiz showHistoryCommoditiesBiz;
    private ShowHistoryCommoditiesView showHistoryCommoditiesView;

    public ShowHistoryCommoditiesPresenterImpl(ShowHistoryCommoditiesView showHistoryCommoditiesView,Context context) {
        this.showHistoryCommoditiesView = showHistoryCommoditiesView;
        this.showHistoryCommoditiesBiz=new ShowHistoryCommoditiesBizImpl(this,context);
    }

    @Override
    public void showHistoryCommodities() {
        showHistoryCommoditiesBiz.showHistoryCommodities();
    }

    @Override
    public void closeDataBase() {
        showHistoryCommoditiesBiz.closeDataBase();
    }

    @Override
    public void showHistoryCommoditiesSucc(ArrayList<Commodities> list) {
        showHistoryCommoditiesView.showListView(list);
    }
}
